<template>
  <div>
    <div ref="test" id="test">获取我</div>
    <button @click="getDOMByRef">获取元素</button>
    <button @click="getDOMById">获取元素</button>
    <School ref="sch" id="sch" />
  </div>
</template>

<script>
import School from './components/School'

export default {
  name: 'App',
  components: {
    School
  },
  methods: {
    getDOMByRef() {
      console.log(this.$refs.test.innerHTML)
    },
    getDOMById() {
      console.log(document.querySelector('#sch'))
    }
  }
}
</script>

<style>
</style>